set IntDir=%1
set SolutionDir=%2
set SolutionDir=%SolutionDir:~1%
set SolutionDir=%SolutionDir:~0,-1%
set WindowsSdkDir=%3
set WindowsSdkDir=%WindowsSdkDir:~1%
set WindowsSdkDir=%WindowsSdkDir:~0,-1%
set ConfigurationName=%4
set Interop=UIAutomationCore

set


midl /nologo /char signed /env win32  /tlb "%IntDir%\%Interop%.tlb" /h "%IntDir%\%Interop%_h.h" "%WindowsSdkDir%\include\%Interop%.idl"

tlbimp /silent /out:%IntDir%\Raw\Interop.%Interop%.dll /namespace:Interop.UIAutomationCore %IntDir%\%Interop%.tlb

ildasm %IntDir%\Raw\Interop.%Interop%.dll /out=%IntDir%\%Interop%.il /nobar

"%SolutionDir%\CustomizeUiaInterop\bin\%ConfigurationName%\CustomizeUiaInterop" %IntDir%\%Interop%.il %IntDir%\Custom.%Interop%.il

ilasm /dll /output=%IntDir%\Interop.%Interop%.dll %IntDir%\Custom.%Interop%.il